#include <stdio.h>
int main()
{
    int n = 0;
    scanf("%d", &n);
    int arr1[2][2] = {0};
    arr1[0][0] = 1;
    arr1[0][1] = 1;
    arr1[1][0] = 1;
    arr1[1][1] = 0;
    int arr2[2][2] = {0};
    while(n > 3)
    {
        n--;
        arr2[0][0] = arr1[0][0] + arr1[1][0];
        arr2[0][1] = arr1[0][0];
        arr2[1][0] = arr1[1][0] + arr1[1][1];
        arr2[1][1] = arr1[1][0];
        arr1[0][0] = arr2[0][0];
        arr1[0][1] = arr2[0][1];
        arr1[1][0] = arr2[1][0];
        arr1[1][1] = arr2[1][1];
    }
    printf("%d", arr1[0][0] + arr1[0][1]);
    return 0;
}